package com.mjk.manager.amis.core.controller;


import com.mjk.common.core.jdbc.service.plus.idbservice.BeeDBService;
import jakarta.servlet.http.HttpServletRequest;
import jakarta.servlet.http.HttpServletResponse;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;

@Controller
@Slf4j
public class EntryController {

	@Autowired
	private BeeDBService beeDBService;


	@GetMapping(value = {"/", "/login"})
	public String redirect() {
		return "forward:/index1.html"; // 重定向到 index.html
	}
	@GetMapping("/mamis/{sysCode:(?!amis|magic|api).+}/**")
	public void systemRoot(HttpServletRequest request, HttpServletResponse response,
						   @PathVariable("sysCode") String sysCode) {
		try {

			request.getRequestDispatcher("/mamis/").forward(request, response);
		} catch (Exception e) {
			log.error(e.getLocalizedMessage(), e);
		}
	}

}
